import request from "../../utils/request"


// 分页条件查询学生列表
export const getStudentListApi = (params) => {
  console.log('调用获取学生列表API, 参数:', params);
  return request.get("/students/page", { params });
}

// 根据学生id查询需要完成的体测项目列表
export const getStudentTestItemListApi = (studentId) => {
  console.log('调用获取体测项目API, studentId:', studentId);
  return request.get(`/students/items/${studentId}`);
}

// 提交学生体测数据
export const submitStudentTestDataApi = (studentId, data) => {
  console.log('提交体测数据API, 学生ID:', studentId, '数据:', data);
  return request.post(`/students/score/${studentId}`, data);
}

// 根据学生id查询学生体测数据
export const getStudentTestDataApi = (studentId) => {
  console.log('调用获取体测数据API, studentId:', studentId);
  return request.get(`/students/score/${studentId}`); 
}

// 修改学生体测数据
export const updateStudentTestDataApi = (studentId, data) => {
  console.log('调用修改体测数据API, studentId:', studentId, '数据:', data);
  return request.put(`/students/score/${studentId}`, data);
}
